axios node js set user agent

108

axios node js set user agent -

axios
    .get(`url`, 
{ headers: { 'User-Agent': 'YOUR-SERVICE-NAME' }  } )
    .then(response => {
      
      // here will be cheerio scraping
    })
    .catch(function(e) {
      console.log(e);
    });

Comments

Submit
0 Comments